package top.yuzt.noticeserver.entity;

import java.util.ArrayList;
import java.util.List;

public class PackMessageFileUsername {

   public PackMessageFileUsername(Messages mesg, String username , List<Messagefiles> messagefiles){
        this.username =username;
        this.mesg = mesg;
        this.fileurlpic = new ArrayList<>();
        this.filenamepic = new ArrayList<>();
        this.otherFileList = new ArrayList<>();
        for (Messagefiles x : messagefiles){
            if (x.getIspic() == 1){
                fileurlpic.add(x.getFilepath());
                filenamepic.add(x.getOrgfilename());
            }else {
                otherFileList.add(new OtherFile(x.getFilepath(),x.getOrgfilename(), x.getRealfilename()));
            }
        }
   }

   private Messages mesg;

   private String username;

   private List<String> fileurlpic;
   private List<String> filenamepic;

   private List<OtherFile> otherFileList;

    public List<String> getFileurlpic() {
        return fileurlpic;
    }

    public void setFileurlpic(List<String> fileurlpic) {
        this.fileurlpic = fileurlpic;
    }

    public List<String> getFilenamepic() {
        return filenamepic;
    }

    public void setFilenamepic(List<String> filenamepic) {
        this.filenamepic = filenamepic;
    }

    public List<OtherFile> getOtherFileList() {
        return otherFileList;
    }

    public void setOtherFileList(List<OtherFile> otherFileList) {
        this.otherFileList = otherFileList;
    }

    public Messages getMesg() {
        return mesg;
    }

    public void setMesg(Messages mesg) {
        this.mesg = mesg;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
}
